package com.hymall.mapper;

import com.hymall.bean.MarketOrder;
import com.hymall.bean.MarketOrderExample;
import com.hymall.bean.vo.AdminOrderChannelVo;
import com.hymall.bean.vo.AdminStatOrderInnerRowsVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;

public interface MarketOrderMapper {
    long countByExample(MarketOrderExample example);

    int deleteByExample(MarketOrderExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(MarketOrder record);

    int insertSelective(MarketOrder record);

    List<MarketOrder> selectByExample(MarketOrderExample example);

    MarketOrder selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") MarketOrder record, @Param("example") MarketOrderExample example);

    int updateByExample(@Param("record") MarketOrder record, @Param("example") MarketOrderExample example);

    int updateByPrimaryKeySelective(MarketOrder record);

    int updateByPrimaryKey(MarketOrder record);

    /**
     * @author 章鹏
     * @description 统计报表 → 订单统计 → 按天统计订单总额，订单量，下单用户数量，客单价
     * @date 2022/7/17 18:17
     * @param []
     * @return java.util.List<com.hymall.bean.vo.AdminStatOrderInnerRowsVO>
     */
    List<AdminStatOrderInnerRowsVO> selectOrderCountGroupByDay();


    /**
     * @author 牟治宇
     * @description 商场管理--订单管理--发货--更新订单状态
     * @date 2022/7/18 13:57
     * @param [orderId, shipChannel, shipSn]
     * @return int
     */
    int updateShip(Integer orderId, String shipChannel, String shipSn);

    /**
     * @author 牟治宇
     * @description 商场管理--订单管理--退货--查询退款金额
     * @date 2022/7/18 14:31
     * @param [orderId]
     * @return java.math.BigDecimal
     */
    BigDecimal selectActualPrice(Integer orderId);


    /**
     * @author 牟治宇
     * @description 商场管理--订单管理--退货--更新退款情况
     * @date 2022/7/18 14:33
     * @param [orderId]
     * @return int
     */
    int orderRefund(Integer orderId);

    List<AdminOrderChannelVo> selectChannel();

    String selectChannelByCode(String code);

    int insertComment(String commentId, String content);

}